win32: Ensure we update GDK_WINDOW_STATE_FOCUSED
authorAlexander Larsson <alexl@redhat.com>
Fri, 16 Mar 2012 10:34:58 +0000 (11:34 +0100)
committerAlexander Larsson <alexl@redhat.com>
Fri, 16 Mar 2012 10:34:58 +0000 (11:34 +0100)
When windows get activated/inactivated we need to update STATE_FOCUSED.
Without this the backdrop theme state will not work.

gdk/win32/gdkevents-win32.c

index 7088600ffe8385f2f9dcdcee57c5cb01bd3f7a37..fc01381f6c5773453ca4b9cefb0fb3212e30ed77 100644 (file)
@@ -3217,6 +3217,11 @@ gdk_event_translate (MSG  *msg,
          break;
        }
 
+      if (LOWORD (msg->wParam) == WA_INACTIVE)
+       gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
+      else
+       gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED);
+
       /* Bring any tablet contexts to the top of the overlap order when
        * one of our windows is activated.
        * NOTE: It doesn't seem to work well if it is done in WM_ACTIVATEAPP